import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useUserStore = defineStore(
    'user',
()=> {
    const isLogin = ref(false)
    const userInfo = ref({})
    const setUser = (obj) => {
        userInfo.value = obj
    }
    const login = () => {
        isLogin.value = true
    }
    return {
        userInfo,
        setUser,
        isLogin,
        login
        }
    },
    {
        persist: true,
    }
)